package com.ethan.minimalist.mvp.model

import com.cxz.kotlin.baselibs.mvp.BaseModel
import com.ethan.minimalist.bean.HttpResult
import com.ethan.minimalist.bean.UserBean
import com.ethan.minimalist.http.MainRetrofit
import com.ethan.minimalist.mvp.contract.IWithdrawContract
import io.reactivex.Observable

/**
 * @author admin
 * @date 2018/11/20
 * @desc
 */
class WithdrawModel : BaseModel(), IWithdrawContract.Model {
    override fun updateInfo(user: UserBean, money: String): Observable<HttpResult<UserBean>> {
        val sex = user.sex
        val birthday = user.birthday
        val nickName = user.nickName
        val height = user.height
        val weight = user.weight
        val avatar = user.avatar
        var balance = money
        val yestodayMoney = user.yestodayMoney
        val coins = user.coins
        val setting = user.setting
        return MainRetrofit.service.updateInfo(sex,birthday,nickName,height,weight,avatar,balance,yestodayMoney,coins,setting)
    }

    override fun createKitPwd(): Observable<HttpResult<Any>> {
        return MainRetrofit.service.createKitPwd()
    }

    override fun kitMoney(password:String,money:String): Observable<HttpResult<UserBean>> {
        return MainRetrofit.service.kitMoney(password,money)
    }
}